@extends('company.company')

@section('title','企业中心')

@section('rightcontainer')
<div id="wendang" class="member-container" style="margin:0">
    <div class='ent_zhph ent3'>
    	<ul class="mem_cate clearfix">
    		<li class='firt-li'>排序方法:</li>
    		<li>
    			<a href='#' class="ent-bgcolor" >时间</a>
    		</li>
    		<li>|</li>
    		<li>
    			<a href='#' class="" >浏览量</a>
    		</li>
    		<li>|</li>
    		<li>
    			<a href='#' class="" >评论</a>
    		</li>
    	</ul>
    </div>
    @foreach($documents as $key=>$document)
    <div class="mem_cont @if($key>0) bordertop @endif" id="news_{{$document->id}}">
    	<div class="fl cont_pic">
    		<a href="{{url('/teaches/company/show/'.$document->id)}}">
    		  <img src="@if(count($document->attachment)>0){{$document->attachment->url}}@else{{ asset('../images/front/adriod.png')}}@endif" width="170" height="112">
    	    </a>
    	</div>
    	<div class="fl cont_text" >
    		<div class="list-title" >
    		    <span class="fl" style="padding-right: 10px">
    		      @if($document->is_validate == 1)
    		      <img alt="审核通过" title="审核通过" src="{{ asset('/images/reset/passed.png') }}">
    		      @elseif($document->is_validate == 2)
    		      <img alt="审核不通过" title="文章内容不符，审核不通过！" src="{{ asset('/images/reset/no_pass.png') }}">
    		      @else
    		      <img alt="待审核" title="等待管理员审核" src="{{ asset('/images/reset/no_validate.png') }}">
    		      @endif
    		    </span>
        		<a href="{{url('/teaches/company/show/'.$document->id)}}"><span class="fl ft-18 cor-2">{{$document->name}}</span></a> <span class="ft-14 ml-10"></span>
        		<span class="fr">
        			<a href="{{url('/company/center/document/'.$document->id.'/edit')}}" style="margin-right: 25px">
        			 <img src="{{ asset('/images/front/member/write.png')}}">
        		    </a>
        			<a href="javascript:void(0)" onclick="delete_one('/company/center/document/{{$document->id}}','{{$document->id}}','{{csrf_token()}}')">
        			 <img src="{{ asset('/images/front/member/trash.png')}}">
        			</a>
        		</span>
        		<div class="clearfix"></div>
    	   </div>
    	   <div class="ft-14 cor-4 mt-20" style="height:30px;line-height: 30px;x">类型：
    	       <span>@if($document->teaches_type==1)视频教程@elseif($document->teaches_type==2)OFFICE教程@elseif($document->teaches_type==3)PPT教程@else 分步教程@endif</span>
    	   </div>
           <div style="height:16px;line-height: 16px;">
    			<ul class="mem_bt">
    				<li class="ft-14 cor-4">评论数：<span>{{$document->comments_num}}</span></li>
    				<li class="ml-10 ft-14 cor-4" >积分：<span>{{$document->price}}</span></li>
    				<li class="ml-10 ft-14 cor-4">浏览次数：<span>{{$document->views_num}}</span></li>
    			</ul>
    			<span class="fr ft-14 cor-4">{{$document->user->name}} 发表于{{date("Y-m-d",strtotime($document->created_at))}}</span>
    			<div class="clearfix"></div>
        	</div>
        </div>
    	<div class="clearfix"></div>
    </div>
    @endforeach
    <div class="paginate">{!! $documents->render() !!} </div>
 </div>
@stop

<!-- 底部块 -->
@section('footer')
    @parent
@stop

